clear all;
clc;
load('K2_nov26.dat');
K = K2_nov26;
part_tmp = load('part_tmp.dat');
counts = load('count_tmp.dat');



sum1c1 = 0;
a = 3;
for i = 1 : counts(1,1)
        b = part_tmp(i,1) +1;
        sum1c1 = sum1c1 + K(a,b);
end

sum2c1 =1.5893e+05;
sum1c1
K1 = K(a,a) - 2*sum1c1/counts(1,1) + sum2c1/(counts(1,1)^2);



sum1c2 = 0;
for i = 1 : counts(2,1)
    b = part_tmp(i,2) +1;
    sum1c2 = sum1c2 + K(a,b);
end

sum2c2 = 1.5494e+05;
sum1c2
K2 = K(a,a) - 2*sum1c2/counts(2,1) + sum2c2/(counts(2,1)^2);

K1
K2

new_part_tmp = load('new_part.dat');
new_counts = load('new_counts.dat');


